package flc.ast.adapter;


import android.graphics.Color;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.HourWageBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class HourWageAdapter extends StkProviderMultiAdapter<HourWageBean> {


    public HourWageAdapter() {
        addItemProvider(new StkSingleSpanProvider(126));
        addItemProvider(new HourWageProvider());
    }

    private class HourWageProvider extends BaseItemProvider<HourWageBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_hour_wage;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, HourWageBean bean) {
            baseViewHolder.setText(R.id.tvHourWageItemName, bean.getName());
            baseViewHolder.setText(R.id.tvHourWageItemWage, getContext().getString(R.string.hour_income_double, bean.getWage()));
        }
    }

}
